package cn.duli.xianer.service.impl;

import cn.duli.xianer.dao.GoodsPictureMapper;
import cn.duli.xianer.pojo.GoodsPicture;
import cn.duli.xianer.service.GoodsPictureService;
import com.github.pagehelper.Page;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class GoodsPictureServiceImpl implements GoodsPictureService {

    @Resource
    private GoodsPictureMapper goodsPictureMapper;

    @Override
    public void save(GoodsPicture goodsPicture) {
        goodsPictureMapper.save(goodsPicture);
    }

    @Override
    public void deleteById(Integer gpId) {
        goodsPictureMapper.deleteById(gpId);
    }

    @Override
    public void update(GoodsPicture goodsPicture) {
        goodsPictureMapper.update(goodsPicture);
    }

    @Override
    public void updateMainPic(GoodsPicture goodsPicture) {
        goodsPictureMapper.updateMainPic(goodsPicture);
    }

    @Override
    public List<GoodsPicture> findByGoodsId(Integer gpGid) {
        return goodsPictureMapper.findByGoodsId(gpGid);
    }

    @Override
    public GoodsPicture findMainPicByGoodsId(Integer gpGid) {
        return goodsPictureMapper.findMainPicByGoodsId(gpGid);
    }

    @Override
    public Page<GoodsPicture> findAll() {
        return goodsPictureMapper.findAll();
    }

    @Override
    public void batchDelete(List<Integer> list) {
        goodsPictureMapper.batchDelete(list);
    }

    @Override
    public GoodsPicture findById(Integer gpId) {
        return goodsPictureMapper.findById(gpId);
    }

    @Override
    public void updateById(GoodsPicture goodsPicture) {
        goodsPictureMapper.updateById(goodsPicture);
    }
}
